package cn.initcap.designpattern.pattern.behavioral.command;

/**
 * 命令模式
 *
 * @author initcap
 * @date Created in 2018/10/31 PM10:40.
 */
public class Test {

    public static void main(String[] args) {
        CourseVideo courseVideo = new CourseVideo("Java设计模式");
        OpenCourseVideoCommand openCourseVideoCommand = new OpenCourseVideoCommand(courseVideo);
        CloseCourseVideoCommand closeCourseVideoCommand = new CloseCourseVideoCommand(courseVideo);

        Staff staff = new Staff();
        // 接收命令
        staff.addCommand(openCourseVideoCommand);
        staff.addCommand(closeCourseVideoCommand);

        // 执行命令
        staff.executeCommands();

    }

}
